<?
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-list.php");
?>





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="../css/<? echo $theme_folder ?>/user.css" rel="stylesheet" type="text/css"/>
    <?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <?php include 'modules/head.php'; ?>
</head>


<body>

<div id="topbar">
    <?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?>
</div>

<div id="container" class="<? echo $system_part ?>">


        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>





            <div id="content">
                <?php $page_title='员工列表';?>
                <?php include ROOT_PATH_.'/controller/common/module/mod-page-title.php'; ?>




    <?php include 'modules/mod-search.php'; ?>



    <div class="layui-form">
<!--        <button class="layui-btn layui-btn-sm" id="quanxuan"><i class="layui-icon">&#x1005;</i>全选</button>-->
<!--        <button class="layui-btn layui-btn-sm" id="buxuan"><i class="layui-icon">&#xe63f;</i>不选</button>-->
<!--        <a class="layui-btn layui-btn-sm" href="collect.php?sys_part=--><?php //echo $system_part?><!--"><i class="fa fa-bar-chart-o" aria-hidden="true"></i>  统计</a>-->
        <a class="layui-btn layui-btn-sm" href="detail-add.php?sys_part=unit&sys_part=employee"><i class="layui-icon">&#xe608;</i>  新增</a>
    </div>

    <hr />





<!-- 用$system_part .list_boxes来控制来到确认板块信息显示-->
<div class="list-box">

<div class="list-boxes">







<table class="layui-table">
  <colgroup>
    <col width="60">
    <col width="180">
	<col >
	<col >
	<col >
	<col >
	<col >
		<col >
			<col >

	<col width="180">
      <col >
	<col width="200">
  </colgroup>
  <thead>
    <tr>
      <th>序号</th>
      <th>姓名</th>
      <th>工号</th>
      <th>工龄</th>
      <th>职位</th>
      <th>电话</th>
<th>绑定公众号</th>
      <th>状态</th>
      <th>登陆权限</th>
       <th>入职时间</th>
<th>跟进客户</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>





  <?php
	for ($i = 0; $i < $detailnum; $i++) {
    ?>
        <tr id="item<?echo $detail[$i]['nid']?>" >
      <td><?echo $i+1+$plate['page_list_num']*($nowpageid-1) ?></td>

            <td style="color:<?if($detail[$i]['gender']=="男"){echo "#1e9fff";}else{echo "#ff1e7b";}?>">
                <?echo $detail[$i]['name']?>
                <span >
        <?if($detail[$i]['gender']=="男"){?>
            <i class="fa fa-male" aria-hidden="true">  </i>
        <?}else{?>
            <i class="fa fa-female" aria-hidden="true"></i>
        <?}?>
    </span>
            </td>

        <td><?echo $detail[$i]['mid']?></td>

<?
//判断离职日期。如果没有离职日期，就取当前日期。
if($detail[$i]['leavedate']=="0000-00-00 00:00:00")
{
    $detail[$i]['leavedate']=date("Y-m-d");
}

$age=count_period($detail[$i]['applydate'],$detail[$i]['leavedate']);

?>
      <td><?echo $age[0]."年".$age[1]."月".$age[2]."天";?></td>
<!--      --><?// $department=select_one_line_all_items($table_Prefix."department","nid = '".$detail[$i]['departmentid']."'")?>
<!--	  <td>--><?//echo $department['name']?><!--</td>-->


	  <td><?echo $detail[$i]['position']?></td>
	  <td><?echo $detail[$i]['phone']?></td>
	  <td><?if($detail[$i]['openid']){echo "是";}else{echo "否";}?></td>
	  <td><?echo $detail[$i]['status']?></td>
	  <td><? if($detail[$i]['authority']=="是"){echo "是";}else{echo "否";}?></td>
           <td><?echo $detail[$i]['applydate']?></td>
	   <td><?
          $condition['data']=$member_list;
          $condition['target']=$detail[$i]['nid'];
          echo count_num_in_array($condition)?> 

	  <td>
<!--  <a href="detail-edit.php?sys_part=employee&nid=--><?// echo $detail[$i]['nid']?><!--&nowpageid=--><?//echo $nowpageid?><!--" class="layui-btn  layui-btn-sm" >-->
<!--    <i class="layui-icon">&#xe642;</i>修改-->
<!--  </a>-->


    <a href="javascript:void(0)" onclick="delItem (<?php echo $detail[$i]['nid']?>)"
       class="delete layui-btn  layui-btn-sm" > <i class="layui-icon">&#xe640;</i>删除
    </a>



    <a href="detail-statistic.php?sys_part=employee&nid=<? echo $detail[$i]['nid']?>&nowpageid=<? echo $_REQUEST['nowpageid'] ?>"
       class="layui-btn  layui-btn-sm" target="_blank">
        <i class="fa fa-bar-chart-o" aria-hidden="true"></i>信息
    </a>


          <!--
          这部分涉及后期的财务系统。保留一下
          这部分涉及后期的财务系统。保留一下
          这部分涉及后期的财务系统。保留一下
          这部分涉及后期的财务系统。保留一下
          这部分涉及后期的财务系统。保留一下
          <div class="layui-btn-group" style="margin-left: 10px">
              <a href="../../finance/view/detail-add.php?sys_part=finance&nid=<? echo $detail[$i]['nid'] ?>&action=salary"
                 class="layui-btn  layui-btn-sm" target="_blank">
                  发薪
              </a>
              <a href="../../finance/view/detail-add.php?sys_part=finance&nid=<? echo $detail[$i]['nid'] ?>&action=commission"
                 class="layui-btn  layui-btn-sm" target="_blank">
                  提成
              </a>
              <a href="../../finance/view/detail-add.php?sys_part=finance&nid=<? echo $detail[$i]['nid'] ?>&action=bonus"
                 class="layui-btn  layui-btn-sm" target="_blank">
                  奖金
              </a>
          </div>
-->








  </td>
    </tr>
  <?php
}
?>



  </tbody>
</table>






</div>


    <!-- todo 这里需要做0判断-->
    <!-- 翻页代码-->
    <?php include ROOT_PATH_ . '/controller/common/module/mod_page_numbers.php'; ?>
</div>


<!--list-box end-->
</div>

<!--content端點01-->

<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>







<!--删除box-->
<?php include '../modules/deletebar.php'; ?>
<!--删除box end-->

<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>
</body>
</html>
